package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.FileUploadInfo;
import com.ruoyi.system.mapper.FileUploadMapper;
import com.ruoyi.system.service.IFileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileUploadServiceImpl implements IFileUploadService {

    @Autowired
    private FileUploadMapper fileUploadMapper;

    @Override
    public int insertFileUpload(FileUploadInfo fileUploadInfo) {
        return fileUploadMapper.insertFileUpload(fileUploadInfo);
    }

    @Override
    public List<FileUploadInfo> getFileUploadListByKey(String belongKey) {
        return fileUploadMapper.getFileUploadListByKey(belongKey);
    }

    @Override
    public int deleteFile(String fileId) {
        return fileUploadMapper.deleteFile(fileId);
    }

    @Override
    public int deleteAll(String belongKeys) {
        return fileUploadMapper.deleteAll(Convert.toStrArray(belongKeys));
    }

    @Override
    public Integer getFileCountByKey(String belongKey) {
        return fileUploadMapper.getFileCountByKey(belongKey);
    }
}
